home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1142 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  853 b 

  1. Path: unix.sri.com!usenet
  2. From: mklenk@updike.sri.com (Mark Klenk)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Problem with sscanf on DEC Alpha
  5. Date: 11 Jan 1996 18:06:18 GMT
  6. Organization: SRI International
  7. Message-ID: <4d3jiq$cgm@unix.sri.com>
  8. References: <4d3f0c$mfq@colossus.holonet.net>
  9. Reply-To: mklenk@updike.sri.com
  10. NNTP-Posting-Host: 204.75.161.40
  11.  
  12. Mitch Miller wrote:
  13. >
  14. >I'm having a problem with a line in my program:
  15. >
  16. >  sscanf( sInputLine, "%3d%3d%10.4f%10.4f", &iAtom1, 
  17. >    &iAtom2, &(F3D->r3DV1), &(F3D->r3DV2) );
  18. >
  19. >F3D is a pointer to struct and the struct has double members
  20. >r3DV1 and r3DV2.
  21.  
  22.     If r3DV1 and r3DV2 are 'double's, your sscanf format
  23.     string should use %10.4lf%10.4lf instead.  Otherwise,
  24.     sscanf assumes pointers to float's, which are not
  25.     usually the same size as double's.
  26.  
  27. ---
  28.  
  29. mklenk@coronacorp.com       (Mark Klenk)
  30.  
  31.  
  32.  
  33.